import axios from 'axios';
import { API_ROOT } from '../config.jsx';

export const GET_CONFERENCE = 'GET_CONFERENCE';
export const INIT_CONFERENCE = 'INIT_CONFERENCE';

export function conference(code, year) {
    axios.defaults.headers.common['Authorization'] = sessionStorage.token;
    const info = axios.get(`${API_ROOT}/WechatApi/Conference/${code}/${year}`);
    return {
        type: GET_CONFERENCE,
        payload: info
    };
}

export function initConference() {
    return {
        type: INIT_CONFERENCE,
        payload: undefined
    };
}